package me.huangxiang.data_structure_and_algorithm.tree;

public class BiTreeTraverseApp {
    public static void main(String[] args) {
        BiTree root = new BiTree("root");
        BiTree a = new BiTree("A");
        BiTree b = new BiTree("B");
        BiTree c = new BiTree("C");
        BiTree d = new BiTree("D");
        BiTree e = new BiTree("E");
        BiTree f = new BiTree("F");
        BiTree g = new BiTree("G");
        BiTree h = new BiTree("H");

        root.lChild = b;
        root.rChild = c;

        b.lChild = d;
        b.rChild = e;
        c.rChild = f;
        d.lChild = g;
        e.lChild = h;
        e.rChild = a;

        System.out.println("---------------------前序遍历----------------------------");
        BiTreeTraverse.preOrderTraverse(root);
        System.out.println("---------------------中序遍历----------------------------");
        BiTreeTraverse.inOrderTraverse(root);
        System.out.println("---------------------后序遍历----------------------------");
        BiTreeTraverse.postOrderTraverse(root);
    }
}
